package com.goulin.sprmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.goulin.sprmvc.domain.DemoObj;

@Controller
public class AdviceController {
	@RequestMapping("/advice")
	public String getSomething(@ModelAttribute("msg") String msg,DemoObj obj){//@ModelAttribute的msg就是全局统一设置的值，传入这里当参数用
		throw new IllegalArgumentException("非常抱歉，参数有错误/n"+"来自modelAttribate:"+msg);//抛出异常，由于全局设置，将会转入错误页面
	}
}
